<template>
  <div class="problem_detail w">
    <h3>题目描述</h3>
    <p class="post_content" v-for="problem in problems" v-if="problem.id == problemID">{{problem.title}}</p>
    <br>
    <h3>输入格式</h3>
    <p class="post_content" v-for="problem in problems" v-if="problem.id == problemID">{{problem.input_format}}</p>
    <br>
    <h3>样例数据</h3>
    <p class="post_content">输入</p>
    <ul class="input_output" v-for="problem in problems" v-if="problem.id == problemID">
      <li v-for="i in problem.input_data.length">{{problem.input_data[i - 1]}}</li>
    </ul>
    <p class="post_content">输出</p>
    <ul class="input_output" v-for="problem in problems" v-if="problem.id == problemID">
      <li v-for="i in problem.output_data.length">{{problem.output_data[i - 1]}}</li>
    </ul>
    <h3>备注</h3>
    <p class="post_content" v-for="problem in problems" v-if="problem.id == problemID">{{problem.remark}}</p>
  </div>
</template>

<script>
export default {
  name: "problem_detail",
  data(){
    return{
      problems: [
        {
          id:1,
          title: '输入两个整数，输出这两个数的积.',
          input_format: '补全 solve() 函数.\n' +
              '函数包含两个参数，a,b (−100000 ≤ a,b ≤ 100000)',
          input_data:['-1 1', '0 2', '-100000 100000'],
          output_data:['-1', '0', '-10000000000'],
          remark:'本题为函数式编程，请使用 C++ 语言完成函数'
        }
      ],
      problemID:this.$route.path.split(':')[1],
    }
  },
  methods:{
    getUrl: function (){
      console.log(this.$route.path)
    }
  }
}
</script>

<style scoped>
@import "../../common/stylus/style.css";
@import "../../assets/css/all.css";
@import "../../assets/css/problem_detail.css";
</style>